Ext.define('PJ.view.setassessmentpaper.configurePaperList', {
    extend: 'AM.default.DefaultList',
    alias: ['widget.celaConfigurePaperList'],
    requires: ['AM.default.DateTime', 
               'AM.default.DefaultDateField'],
    
    initComponent: function(){
    	var me = this;
        me.columns = [{
            header: '问卷名称',
            dataIndex: 'q.paperTitle',
            flex: 1,
            minWidth: 70,
			renderer: function(value, metaData, record){
				metaData.tdAttr = 'data-qtip="' + value + '"';
				return value;
			}
        }, {
            header: '开始时间',
            dataIndex: 'q.starDate',
            width: 90,
            renderer: function(value, metaData, record){
                return value;
            }
        }, {
            header: '结束时间',
            dataIndex: 'q.endDate',
            width: 90,
            renderer: function(value, metaData, record){
                return value;
            }
        }, {
            header: '创建人',
            dataIndex: 'founder',
            width: 80,
            renderer: function(value, metaData, record){
            	return value;
            }
        }];
        me.store = Ext.create('PJ.store.setassessmentpaper.configurePaperList', {
            isLoad: false
        });
        this.loadType = gj_onlineLearning_constant.loadType;//加载方式
        me.callParent(arguments);
    },
    
    listeners: {
    	viewready: function(){
    		this.addDocked([{
    			dock: 'top',
    			xtype: "searchform",
    			columnCount: 2,
    			fieldDefaults: {
    				labelAlign: 'right',
    				labelWidth: 70
    			},
    			items: [{
    				xtype: 'textfield',
    				fieldLabel: '问卷名称',
    				name: 'paperTitle',
    				emptyText: "请输入问卷名称"
    			}, {
    				xtype: 'defaultDate',
    				fieldLabel: '开始时间',
    				name: 'searchStartTime',
    				id: 'setConfigurePaperSD',
    				vtype: 'startLessEndDate',
    				startLessEndDate: {
    					targetCmpId: 'setConfigurePaperED',
    					isStart: true
    				},
    				emptyText: "请输入开始时间"
    			}, {
    				xtype: 'defaultDate',
    				fieldLabel: '结束时间',
    				name: 'searchEndTime',
    				id: 'setConfigurePaperED',
    				vtype: 'startLessEndDate',
    				vtypeText: '结束时间不能早于开始时间！',
    				startLessEndDate: {
    					targetCmpId: 'setConfigurePaperSD',
    					isStart: false
    				},
    				emptyText: "请输入结束时间"
    			}],
    			grid: this
    		}]);
    		var store = this.store;
    		var params = store.proxy.extraParams;
    		var newParams = {};
    		Ext.apply(params, newParams);
    		store.isLoad = true;
    		store.load();
    		// 触发权限过滤事件
    		this.fireEvent("permission", this);
    	}
    }
});

